package cn.edu.tsinghua.cic.ccss.entity;

import java.util.Arrays;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.forten.core.entity.rdb.hibernate.HibernateEntityWithCurrentTimeId;

/**
 * @author cj
 *
 */
@Entity
@Table(name = "THRS_GBGL_KJB")
public class Courseware extends HibernateEntityWithCurrentTimeId{

	/**
	 * 
	 */
	private static final long serialVersionUID = 5288534455820716429L;
	@Column(name = "KCID")
	private Long courseId;
	@Column(name = "KJMC")
	private String wareName;
	@Column(name = "kj")
	private byte[] courseware;
	@Column(name = "bz")
	private String bz;
	@Column(name = "CZSJ")
	private String czsj;
	@Column(name = "CZR")
	private String czr;
	@Column(name = "KJDX")
	private String fileSize;
	
	
	public Long getCourseId() {
		return courseId;
	}
	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}
	public String getWareName() {
		return wareName;
	}
	public void setWareName(String wareName) {
		this.wareName = wareName;
	}
	public byte[] getCourseware() {
		return courseware;
	}
	public void setCourseware(byte[] courseware) {
		this.courseware = courseware;
	}
	
	public String getBz() {
		return bz;
	}
	public void setBz(String bz) {
		this.bz = bz;
	}
	
	public String getCzsj() {
		return czsj;
	}
	public void setCzsj(String czsj) {
		this.czsj = czsj;
	}
	public String getCzr() {
		return czr;
	}
	public void setCzr(String czr) {
		this.czr = czr;
	}
	
	public String getFileSize() {
		return fileSize;
	}
	public void setFileSize(String fileSize) {
		this.fileSize = fileSize;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = super.hashCode();
		result = prime * result + ((bz == null) ? 0 : bz.hashCode());
		result = prime * result
				+ ((courseId == null) ? 0 : courseId.hashCode());
		result = prime * result + Arrays.hashCode(courseware);
		result = prime * result + ((czr == null) ? 0 : czr.hashCode());
		result = prime * result + ((czsj == null) ? 0 : czsj.hashCode());
		result = prime * result
				+ ((fileSize == null) ? 0 : fileSize.hashCode());
		result = prime * result
				+ ((wareName == null) ? 0 : wareName.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		Courseware other = (Courseware) obj;
		if (bz == null) {
			if (other.bz != null)
				return false;
		} else if (!bz.equals(other.bz))
			return false;
		if (courseId == null) {
			if (other.courseId != null)
				return false;
		} else if (!courseId.equals(other.courseId))
			return false;
		if (!Arrays.equals(courseware, other.courseware))
			return false;
		if (czr == null) {
			if (other.czr != null)
				return false;
		} else if (!czr.equals(other.czr))
			return false;
		if (czsj == null) {
			if (other.czsj != null)
				return false;
		} else if (!czsj.equals(other.czsj))
			return false;
		if (fileSize == null) {
			if (other.fileSize != null)
				return false;
		} else if (!fileSize.equals(other.fileSize))
			return false;
		if (wareName == null) {
			if (other.wareName != null)
				return false;
		} else if (!wareName.equals(other.wareName))
			return false;
		return true;
	}
	@Override
	public String toString() {
		return "Courseware [courseId=" + courseId + ", wareName=" + wareName
				+ ", courseware=" + Arrays.toString(courseware) + ", bz=" + bz
				+ ", czsj=" + czsj + ", czr=" + czr + ", fileSize=" + fileSize
				+ "]";
	}
	
	
	
}
